home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1998 August / PC Plus SuperCD 50a Issue 142 (CD142a) (August 1998).iso / trial / demon / TURNPIKE.1 / CLASSES.ZIP / sun / NET / MulticastSocket.class (.txt) next >
Encoding:
Java Class File  |  1997-04-14  |  1.2 KB  |  45 lines

  1. package sun.net;
  2.  
  3. import java.io.IOException;
  4. import java.net.DatagramPacket;
  5. import java.net.DatagramSocket;
  6. import java.net.InetAddress;
  7. import java.net.SocketException;
  8.  
  9. public final class MulticastSocket extends DatagramSocket {
  10.    public MulticastSocket() throws SocketException {
  11.    }
  12.  
  13.    public MulticastSocket(int var1) throws SocketException {
  14.       super(var1);
  15.    }
  16.  
  17.    public void joinGroup(InetAddress var1) throws SocketException {
  18.       this.multicastJoin(var1);
  19.    }
  20.  
  21.    public void leaveGroup(InetAddress var1) throws SocketException {
  22.       this.multicastLeave(var1);
  23.    }
  24.  
  25.    public synchronized void send(DatagramPacket var1, byte var2) throws IOException, SocketException {
  26.       SecurityManager var3 = System.getSecurityManager();
  27.       if (var3 != null) {
  28.          var3.checkConnect(var1.getAddress().getHostAddress(), var1.getPort());
  29.       }
  30.  
  31.       this.setTTL(var2);
  32.       ((DatagramSocket)this).send(var1);
  33.    }
  34.  
  35.    private native void setTTL(byte var1);
  36.  
  37.    private native void multicastJoin(InetAddress var1);
  38.  
  39.    private native void multicastLeave(InetAddress var1);
  40.  
  41.    static {
  42.       System.loadLibrary("net");
  43.    }
  44. }
  45.